package com.jy.adscm.zltx.controller;


import com.jy.adscm.exception.AdscmSystemException;
import com.jy.adscm.support.SimpleCoreResponse;
import com.jy.adscm.zltx.bean.JyDrawingList;
import com.jy.adscm.zltx.bean.JyDrawingRelation;
import com.jy.adscm.zltx.service.JyDrawingListService;
import com.jy.adscm.zltx.service.JyDrawingRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yyy
 * @since 2019-02-21
 */
@RestController
@RequestMapping("/adscm/zltx/jyDrawingListTree")
public class JyDrawingListTreeController {

      @Autowired
    JyDrawingListService jyDrawingListService;

    @RequestMapping("/insert")
    public SimpleCoreResponse insert( @RequestBody JyDrawingList jyDrawingList, HttpServletRequest request) throws AdscmSystemException {
        return new SimpleCoreResponse("200","新增成功" ,jyDrawingListService.insertJyDrawingListTree(jyDrawingList));
    }
    @RequestMapping("/delete/{id}")
    public SimpleCoreResponse delete(@PathVariable Integer id, HttpServletRequest request) throws AdscmSystemException {
        return new SimpleCoreResponse("200","删除成功" ,jyDrawingListService.deleteJyDrawingListTree(id));
    }
    @RequestMapping("/update")
    public SimpleCoreResponse update(@RequestBody JyDrawingList jyDrawingList, HttpServletRequest request) throws AdscmSystemException {
        return new SimpleCoreResponse("200","修改成功" ,jyDrawingListService.updateJyDrawingListTree(jyDrawingList));
    }
}

